var len = 500;
for (var i = 0; i < len; i++) {
  var $star = $(`<div class="star">
        <div class="counter">
            <div class="slide">
            <div class="light"></div>
            <div class="light"></div>
            <div class="light"></div>
          </div>
        </div>
      </div>`);
  var x = Math.random() * 1200 - 600 + "px",
    y = Math.random() * 800 - 400 + "px",
    z = Math.random() * 500 - 250 + "px";
  $star.css({ transform: "translate3d(" + x + "," + y + "," + z + ")" });
  // Star delay
  $star.find(".slide").css({ "animation-delay": -50 * Math.random() + "s" });
  $(".stars").append($star);
}
